import java.util.StringTokenizer;
import java.util.Vector;

class P477 {

       static final int circle = 99;
       static final int rect = 114;

  public static void main(String[] args) {


          Vector figures = new Vector();
      String line = readLn();
      while (!line.equals("*")) {
          StringTokenizer st = new StringTokenizer(line);
          int type  = (int) st.nextToken().charAt(0);
          double[] array = null;
          switch (type) {
          case rect :
                  double uLx = new Double(st.nextToken()).doubleValue();
                  double uLy = new Double(st.nextToken()).doubleValue();
                  double lRx = new Double(st.nextToken()).doubleValue();
                  double lRy = new Double(st.nextToken()).doubleValue();

                  array = new double[5];

                  array[0] = rect;
                  array[1] = uLx;
                  array[2] = uLy;
                  array[3] = lRx;
                  array[4] = lRy;
                  figures.addElement(array);
                  break;
          case circle :
                  double x0 = new Double(st.nextToken()).doubleValue();
                  double y0 = new Double(st.nextToken()).doubleValue();
                  double c = new Double(st.nextToken()).doubleValue();

                  array = new double[4];
                  array[0] = circle;
                  array[1] = x0;
                  array[2] = y0;
                  array[3] = c;
                  figures.addElement(array);
                  break;
          }



          line = readLn();
      }
      line = readLn();
      int counter = 1;
      while(!line.equals("9999.9 9999.9")) {
          StringTokenizer st1 = new StringTokenizer(line);
          double x = new Double(st1.nextToken()).doubleValue();
          double y = new Double(st1.nextToken()).doubleValue();
          process(counter, x,y, figures);
          counter++;
          line = readLn();
      }
  }

  private static void process(int counter, double x, double y, Vector figures) {
      boolean insideOne = false;
      for (int k = 0; k < figures.size(); k++) {
          if (isInside(x, y, (double[])figures.elementAt(k))) {
              System.out.println("Point " + counter + " is contained in figure " + (k + 1));
              insideOne = true;
          }
      }
      if (!insideOne) {
          System.out.println("Point "+ counter + " is not contained in any figure");
      }
  }

  private static boolean isInside(double x, double y, double[] ds) {
      switch ((int)ds[0]) {
      case rect :
          double uLx = ds[1];
          double uLy = ds[2];
          double lRx = ds[3];
          double lRy = ds[4];
          return  x > uLx && x < lRx && y > lRy && y < uLy;
      case circle :
           double x0 = ds[1];
               double y0 = ds[2];
               double c = ds[3];
               return Math.pow(x-x0, 2) +  Math.pow(y-y0, 2) < Math.pow(c, 2);
      }
          return false;
  }

  static String readLn() {
      String newLine = System.getProperty("line.separator");
      StringBuffer buffer = new StringBuffer();
      int car = -1;
      try {
          car = System.in.read();
          while ((car > 0) && (car != newLine.charAt(0))) {
              buffer.append((char)car);
              car = System.in.read();
          }
          if (car == newLine.charAt(0))
          System.in.skip(newLine.length() - 1);
      } catch (java.io.IOException e) { return (null);}
      if ((car < 0) && (buffer.length() == 0)) return (null);
      return (buffer.toString()).trim();
  }

}
